const { defineConfig } = require('@vue/cli-service')

const mockData = require("./src/mock/index")

module.exports = defineConfig({
  transpileDependencies: true,
  devServer:{
    port:5000,
    onAfterSetupMiddleware: function (devServer) {
      if (!devServer) {
        throw new Error('webpack-dev-server is not defined');
      }

      devServer.app.get('/api/list', function (req, res) {
        res.send(mockData)
      });
    }
  }
})
